import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from '../shared/guard/auth.guard';
import { SharedModule } from '../shared/shared.module';

const routes: Routes = [
    { path: '', loadChildren: '../layout/layout.module#LayoutModule', canActivate: [AuthGuard]},
    { path: 'login', loadChildren: '../views/login/login.module#LoginModule'},
    { path: 'signup', loadChildren: '../views/signup/signup.module#SignupModule'},
    { path: 'not-found', loadChildren: '../views/not-found/not-found.module#NotFoundModule' },
    { path: '**', redirectTo: 'not-found' }
];

@NgModule({
    imports: [SharedModule, RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class AppRoutingModule {}
